
/****** Object:  Table [dbo].[PersonNewsDownload]    Script Date: 09/06/2013 20:57:45 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[PersonNewsDownload](
	[Id] [bigint] IDENTITY(1,1) NOT NULL,
	[PersonId] [bigint] NOT NULL,
	[NewsItemId] [bigint] NOT NULL,
	[DateDownloaded] [datetime] NOT NULL,
 CONSTRAINT [PK_PersonNewsDownload] PRIMARY KEY CLUSTERED 
(
	[Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[PersonNewsDownload]  WITH CHECK ADD  CONSTRAINT [FK_PersonNewsDownload_NewsItem] FOREIGN KEY([NewsItemId])
REFERENCES [dbo].[NewsItem] ([Id])
GO

ALTER TABLE [dbo].[PersonNewsDownload] CHECK CONSTRAINT [FK_PersonNewsDownload_NewsItem]
GO

ALTER TABLE [dbo].[PersonNewsDownload]  WITH CHECK ADD  CONSTRAINT [FK_PersonNewsDownload_Person] FOREIGN KEY([PersonId])
REFERENCES [dbo].[Person] ([Id])
GO

ALTER TABLE [dbo].[PersonNewsDownload] CHECK CONSTRAINT [FK_PersonNewsDownload_Person]
GO


